﻿/*
	Version 0.0.1
	Start Date		: 15.11.2013
	Release Date	: 15.11.2013
	Initial Db Script
*/

/*
CREATE TABLE `categories` (
	`Id` INT(11) NOT NULL AUTO_INCREMENT,
	`Name` VARCHAR(100) NOT NULL,
	PRIMARY KEY (`Id`)
)
ENGINE=InnoDB;

CREATE TABLE `articles` (
	`Id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`Title` VARCHAR(200) NOT NULL,
	`Category_Id` INT(11) NOT NULL,
	`Content` LONGTEXT NOT NULL,
	`Views` BIGINT(20) NOT NULL,
	`Likes` BIGINT(20) NOT NULL,	
	PRIMARY KEY (`Id`)
)
ENGINE=InnoDB;

CREATE TABLE `users` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`user_name` VARCHAR(120) NOT NULL,
	`password` VARCHAR(150) NOT NULL,
	`user_type` INT(10) NULL DEFAULT '10' COMMENT '1: ADMIN 10:CLIENT',
	`name` VARCHAR(100) NULL DEFAULT NULL,
	`last_name` VARCHAR(100) NULL DEFAULT NULL,
	`email` VARCHAR(150) NULL DEFAULT NULL,
	`user_logged_in` INT(10) NULL DEFAULT '0',
	PRIMARY KEY (`id`),
	UNIQUE INDEX `UNQ_USERNAME` (`user_name`),
	UNIQUE INDEX `UNQ_EMAIL` (`email`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=13;

INSERT INTO `users` (`id`, `user_name`, `password`, `user_type`, `name`, `last_name`, `email`, `user_logged_in`) VALUES (12, 'admin', '33354741122871651676713774147412831195', 10, NULL, NULL, NULL, 0);


*/